<include file="Public/head"/>
<link href="__PUBLIC__/qwadmin/css/shen/shen.css" rel="stylesheet" type="text/css" />
<style>

     tr{border: none;}
        .div1{display: flex;flex-direction: row;justify-content: center;align-items: flex-start;margin-top: 20px; margin-bottom: 20px;}
        .put1{width: 10%;height: 80%;border: none;}
        .put{border: none;width: 100%;height: 80%;text-align: center;}
        td{height: 40px;border-bottom: 0px;border-right: 0px;}
        th{height: 40px;border-bottom: 0px;border-right: 0px;font-size: 20px;}
        .td button{
            margin-left: :50%;
        }
        #ban{
            width:75%;
            margin:10px auto;
            border: 1px solid #ccc;
            /*padding: 0 -1000px;*/
            box-shadow: 5px 5px 30px #888888;
        }
        #ban table{
            width:90%;
            margin:60px auto;
        }



</style>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }

    </script>


    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>
                    <form method="post" action="{:U('Gu/eadd')}" enctype="multipart/form-data">
                        <h3>导入固定资产信息：</h3><input  type="file" name="file" />
                        <input type="submit"  value="导入"  style="width:5%;" />
                    </form>
                    


                    <div id="ban" style="">
                            <h2 style="text-align:center;"><b>固定资产分配信息</b></h2><br>
                            <div class="row" style="margin:0px 20px;">
                            <form class="form-inline"  id="formId">
                               
                                <label class="inline"><b>搜索使用人</b>:</label>
                                
                                <input type="text" name="dname" class="form-control">
                                <!-- <input type="hidden" name="x_type" value="1" class="form-control"> -->
                               
                                <div  class="btn btn-purple btn-sm" onclick="bsou()">
                                    <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                    搜索
                                </div>
                                 <div class='btn btn-info' id='bfan' style='width:100px;height:30px;line-height:10px;display:none;'>返回上一级</div>
                                 <!-- <div class='btn btn-info' id='bfen' style='width:120px;height:30px;line-height:10px;'>返回选择</div> -->
                            </form>

                        </div>
                            <table class="table table-bordered" id="tet" >
                                <tr>
                                    <th class="center">ID</th>
                                    <th class="center">编号</th>
                                    <th class="center">资产分类</th>
                                    <th class="center">资产名称</th>
                                    <th class="center">规格型号</th>
                                    <th class="center">单位</th>
                                    <th class="center">原始价格</th>
                                    <th class="center">使用部门</th>
                                    <th class="center">存放地点</th>
                                    <th class="center">领用人</th>
                                    <th class="center">当前使用人</th>
                                    <th class="center">状态</th>
                                    <th class="center">备注</th>
                                    <th class="center">修改</th>

                                </tr>
                                <volist name="list" id="vo">
                                <tr id="tr">
                                    <td class="center">{$vo.id}</td>
                                    <td class="center">{$vo.bhao}</td>
                                    <td class="center">{$vo.class}</td>
                                    <td class="center">{$vo.wname}</td>
                                  
                                    <td class="center">{$vo.gui}</td>
                                    <td class="center">{$vo.com}</td>
                                    <td class="center">{$vo.unit}</td>
                                    <td class="center">{$vo.ment}</td>
                                    <td class="center">{$vo.place}</td>
                                    <td class="center">{$vo.uname}</td>
                                    <td class="center">{$vo.dname}</td>
                                    <td class="center">{$vo.state}</td>
                                    <td class="center">{$vo.content}</td>
                                    <td class="center">
                                        <button  class="xiu" style="color:#000;" onclick="gxiu({$vo.id},this)">修改</button>
                                        <button class="jujue"  onclick="del({$vo.id},this)">删除</button>
                                    </td>
                                    


                                </tr>




                            </volist> 
                            </table>
                            <div style="text-align:center;"> {$page}  </div>       
                          


                    </div>  
                
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<script src="__PUBLIC__/layer/layer.js"></script>
<script src="__PUBLIC__/jquery-1.7.2.min.js"></script>
<script src="__PUBLIC__/js/jHsDate.js"></script>
<!-- inline scripts related to this page -->
<script type="text/javascript">

//劳保用品搜索
    function bsou()
    {
       
        $.ajax({
            type: "POST",
            url:"{:U('Gu/sou')}",
            data:$('#formId').serialize(),// 要提交的表单 
            success: function(data) {
                
                 if (data != 1111) {
                    $('td').remove();
                    for (var i = 0; i < data.length; i++) {
                        // console.log(data);
                        $("<tr><td class='center'>"+data[i].id+"</td><td class='center'>"+data[i].bhao+"</td><td class='center'>"+data[i].class+"</td><td class='center'>"+data[i].wname+"</td><td class='center'>"+data[i].gui+"</td><td class='center'>"+data[i].com+"</td><td class='center'>"+data[i].unit+"</td><td class='center'>"+data[i].ment+"</td><td class='center'>"+data[i].place+"</td><td class='center'>"+data[i].uname+"</td><td class='center'>"+data[i].dname+"</td><td class='center'>"+data[i].state+"</td><td class='center'>"+data[i].content+"</td></tr>").appendTo('#tet');
                        $('#bfan').show();
                        // $('#bfen').hide();
                    }
                    //  for (index in data) {
                    //     // $("#uid"+data[index].id).text(data[index].number);
                    //     // console.log(data[index].id);
                    //     $("<td class='center'>"+data[index].id+"</td><td class='center'>"+data[index].name+"</td><td class='center'>"+data[index].number+"/"+data[index].com+"</td><td class='center'>"+data[index].unit+"/元</td><td class='center'><input type='text' style='width:50px;'>/"+data[index].com+"</td><td class='center'><button class='btn-info' onclick='shen("+data[index].id+",this)'>申请</button></td>").appendTo('#trl');
                    //     // $("<div class='btn btn-info' id='fan' style='width:50px;'>返回</div>").appendTo('#formId');
                    //     $('#lfan').show();
                    // }
                    
               }else{
                    $('td').remove();
                    $("<td class='center' colspan='13' id='bmei'><h2>没有搜索到!!!</h2></td>").appendTo('#tr');
                    $('#bfan').show();
                    // $('#bfen').hide();
               }
               
              
            }
        });
    }



    //返回所有列表
   $('#bfan').click(function(){
         $.ajax({
            type: "POST",
            url:"{:U('Gu/fan')}",
            data:{'lei':1},// 要提交的表单 
            success: function(data) {
            // console.log(data);
            for (var i = 0; i < data.length; i++) {
                // console.log(data);
                $("<tr><td class='center'>"+data[i].id+"</td><td class='center'>"+data[i].bhao+"</td><td class='center'>"+data[i].class+"</td><td class='center'>"+data[i].wname+"</td><td class='center'>"+data[i].gui+"</td><td class='center'>"+data[i].com+"</td><td class='center'>"+data[i].unit+"</td><td class='center'>"+data[i].ment+"</td><td class='center'>"+data[i].place+"</td><td class='center'>"+data[i].uname+"</td><td class='center'>"+data[i].dname+"</td><td class='center'>"+data[i].state+"</td><td class='center'>"+data[i].content+"</td></tr>").appendTo('#tet');
            }
                 $('#bfan').hide();
                 // $('#bmei').remove();
                 // $('#bfen').show();
              
            }
        });
   })




   function gxiu(id,obj)
   {
    // location.header("content-type:text/html;charset=utf-8");
    location.href="{:U('Gu/gxiu')}"+'?id='+id;
    // location.href="{:U('Gu/gxiu') }"+"?id="+id ;
   }


   function del(id,obj)
   {
    // console.log(id);
    var type = 1;
    $.ajax({
            type: "POST",
            url:"{:U('Gu/del')}",
            data:{'id':id,'type':type},// 要提交的表单 
            beforeSend:function(){
                layer.load(0, {shade: false});
            },
            success: function(data) {
                if (data == 1111) {
                        layer.msg('删除成功!', {icon: 1});
                       
                        history.go(0); 
                    }else{
                        layer.msg('删除失败!', {icon: 2});
                    }
            },
            complete: function() {
                layer.closeAll('loading');
            }
        });
   }






</script>
</body>
</html>
